package maven.jyhs.com.servce.impl;

import maven.jyhs.com.dao.TranstfeDao;
import maven.jyhs.com.dao.UserDao;

import maven.jyhs.com.entity.Sea;
import maven.jyhs.com.entity.Search;
import maven.jyhs.com.entity.User;
import maven.jyhs.com.entity.dto.Users;
import maven.jyhs.com.servce.TranstfeSevrce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.SQLException;
import java.util.List;

@Service("transtfeSevrce")
public class TranstfeSevrceImpl implements TranstfeSevrce {
    @Autowired
    TranstfeDao t;

    public void setT(TranstfeDao t) {
        this.t = t;
    }

    @Autowired
    UserDao userDao;
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }



    @Override
    @Transactional
    public int saveSearch(Search search) throws SQLException, IllegalAccessException {
        User user = userDao.id(t.id(search.getId()));

        return 0;
    }

    @Override
    public Boolean delete(int id) throws IllegalAccessException {
        return t.delete(id);
    }

    @Override
    public List<Users> getUsers(Users user) throws SQLException, ClassNotFoundException, IllegalAccessException {
        return t.getUsers(user);
    }

    @Override
    public int limit(Users user) throws SQLException, IllegalAccessException {
        return t.limit(user);
    }

    public List<User> gather() {

        return t.gather();
    }

    @Override
    public long id(int id) throws IllegalAccessException {

        return t.id(id);
    }

    @Override
    public boolean update(User user) {
        return t.update(user);
    }


    @Override
    public int add(User user) {
        return t.add(user);
    }

    @Override
    public int xuogai(int jq, String skname, String fkname) {
        return 0;
    }

    @Override
    public int chishu() throws SQLException, IllegalAccessException {
        return 0;
    }


    @Override
    public int search(Sea sea) throws SQLException, IllegalAccessException {
        return t.search(sea);
    }

    @Override
    public List<Search> getYs(int page, int limit, Sea sea) throws SQLException, ClassNotFoundException, IllegalAccessException {
        return t.getYs(page, limit, sea);
    }

    @Override
    public int login(String phone) throws SQLException, IllegalAccessException {
        return 0;
    }


}
